package com.backend.service.impl;

import com.backend.entity.entity.Users;
import com.backend.entity.entity.WorkOrders;
import com.backend.mapper.RepairmanMapper;
import com.backend.service.RepairmanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 作者:xuSen
 * 日期2025/7/20 11:05
 */
@Service
public class RepairmanServiceImpl implements RepairmanService {
    @Autowired
    private RepairmanMapper repairmanMapper;
    @Override
    public List<WorkOrders> getWorkOrderByStatus(Integer status) {
        return repairmanMapper.getWorkOrderByStatus(status);
    }

    @Override
    public void updateWorkOrderStatus(Integer orderId, Integer status) {
        repairmanMapper.updateWorkOrderStatus(orderId, status);
    }

    @Override
    public WorkOrders getWorkOrderDetail(Integer orderId) {
        return repairmanMapper.getWorkOrderDetail(orderId);
    }

    @Override
    public List<Users> getAllRepairman() {
        return repairmanMapper.getAllRepairman();
    }

    @Override
    public List<WorkOrders> getWorkOrderByStatusAndRepairId(Integer status, Integer repairId) {
        return repairmanMapper.getWorkOrderByStatusAndRepairId(status, repairId);
    }
}
